package com.atguigu.cloud.apis;

import com.atguigu.cloud.resp.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author bairimengchang
 * @version 1.0
 * @project cloud2024
 * @description 库存服务的api接口（供订单模块调用）
 * 下订单->减库存->扣余额->改（订单）状态
 * @date 2024/12/5
 */
@FeignClient(value = "seata-storage-service")
public interface StorageFeignApi {

    /**
     * 扣减库存，按标准来说应该使用PutMapping
     */
//    @PostMapping(value = "/storage/decrease")
    @PutMapping("/storage/decrease")
    ResultData<String> decrease(@RequestParam("productId") Long productId,
                                @RequestParam("count") Integer count);

}
